package com.circle.interests.biz.request;

import com.circle.common.core.validator.AddGroup;
import com.circle.common.core.validator.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author zhou
 * @date 2021/3/27
 */
@Data
@ApiModel(value = "奖品信息")
public class PrizeInfoRequest implements Serializable {

    @Null(groups = {AddGroup.class})
    @NotNull(groups = {UpdateGroup.class})
    @Range(min = 1, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "id，修改时必填")
    private Long id;

    @NotNull(groups = {AddGroup.class})
    @Length(min = 1, max = 64, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "公众号ID")
    private String appId;

    @NotNull(groups = {AddGroup.class})
    @Length(min = 1, max = 64, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "项目ID")
    private String projectId;

    @NotNull(groups = {AddGroup.class})
    @Range(min = 1, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品分类;奖品分类")
    private Long categoryId;

    @Length(max = 32, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品编码;可为空系统自动生成")
    private String code;

    @NotNull(groups = {AddGroup.class})
    @Length(min = 1, max = 64, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品名称;奖品名称")
    private String name;

    @Length(max = 255, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品说明;奖品说明")
    private String remark;

    @NotNull(groups = {AddGroup.class})
    @Length(min = 1, max = 255, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品图片;奖品图片")
    private String img;

    @Length(min = 1, max = 255, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品小图;奖品小图")
    private String smallImg;

    @Range(groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品原价;奖品原价")
    private Integer originalPrice;

    @Range(groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "奖品价格;奖品价格")
    private Integer price;

    @Length(min = 1, max = 32, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "级别名称")
    private String levelName;

    @Range(min = 1, max = 2, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "类型;1直充 2卡密")
    private Integer type;

    @NotNull(groups = {AddGroup.class})
    @Range(min = 1, max = 3, groups = {AddGroup.class, UpdateGroup.class})
    @ApiModelProperty(value = "库存类型;1不限量，2限量，3限量金额")
    private Integer inventoryType;

    @ApiModelProperty(value = "库存总数;限量金额时为金额，单位分")
    private Integer total;

}
